﻿<!doctype html>
<html>
<head>
    <title>SpreadJS - Scatter Sparkline</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

    <link href="../../../external/spreadjs/css/gcspread.sheets.excel2013white.9.40.20161.0.css" rel="stylesheet" type="text/css" />

    <script src="../../../external/external/jquery-1.8.2.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../../../external/spreadjs/gcspread.sheets.all.9.40.20161.0.min.js"></script>

    <script id="scriptInit" type="text/javascript">
        /*code_begin*/
        $(document).ready(function () {
            var spread = new GcSpread.Sheets.Spread(document.getElementById("ss"));
            initSpread(spread);
        });

        function initSpread(spread) {
            var spreadNS = GcSpread.Sheets;
            var sheet = spread.sheets[0];
            sheet.isPaintSuspended(true);

            sheet.addSpan(0, 0, 1, 3);
            sheet.getCell(0, 0).value("Particulate Levels in Rainfall").font("20px Arial").hAlign(spreadNS.HorizontalAlign.center).vAlign(spreadNS.VerticalAlign.center);
            var table1 = sheet.addTable("table1", 1, 0, 10, 3, spreadNS.TableStyles.medium4());
            table1.rowFilter().setShowFilterButton(false);
            sheet.setValue(1, 0, "Daily rainfall");
            sheet.setValue(1, 1, "Particulate level");
            sheet.setValue(1, 2, "Diagram");
            sheet.setValue(2, 0, 2.0);
            sheet.setValue(2, 1, 100);
            sheet.setValue(3, 0, 2.5);
            sheet.setValue(3, 1, 130);
            sheet.setValue(4, 0, 3.0);
            sheet.setValue(4, 1, 120);
            sheet.setValue(5, 0, 3.5);
            sheet.setValue(5, 1, 140);
            sheet.setValue(6, 0, 4.0);
            sheet.setValue(6, 1, 120);
            sheet.setValue(7, 0, 4.5);
            sheet.setValue(7, 1, 110);
            sheet.setValue(8, 0, 5.0);
            sheet.setValue(8, 1, 110);
            sheet.setValue(9, 0, 5.5);
            sheet.setValue(9, 1, 105);
            sheet.setValue(10, 0, 6.0);
            sheet.setValue(10, 1, 100);
            sheet.addSpan(2, 2, 9, 1);
            sheet.setFormula(2, 2, '=SCATTERSPARKLINE(A3:B11,,MIN(A3:A11),MAX(A3:A11),MIN(B3:B11),MAX(B3:B11),AVERAGE(B3:B11),AVERAGE(A3:A11),,,,,TRUE,TRUE,TRUE,"green",,TRUE)');
            sheet.setRowHeight(0, 50);
            for (var i = 1; i < 11; i++) {
                sheet.setRowHeight(i, 25);
            }
            sheet.setColumnWidth(0, 120);
            sheet.setColumnWidth(1, 120);
            sheet.setColumnWidth(2, 200);

            sheet.isPaintSuspended(false);
        };

        /*code_end*/
    </script>

</head>
<body>
<div class="sample-turtorial">
    <div id="ss" style="width:100%; height:420px;border: 1px solid gray;"></div>
</div>
</body>
</html>
